Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Additional methods for node fs module
enfs stands for [E]asy [N]ode [fs]
This module is intended to work as a sub-module of enfspatch
This module will change some behaviors of fs module from node such as creating a queue for opening files when limit is reached, catching the error's and proceeding with the process when possible.
enfsaddins
Valid usage but not the better:
var fs = require("fs");
var enfs = require("enfsaddins")(fs);
It's better to use
var enfs = require("enfspatch");
this will use enfspatch module that implements this module and allows access to all it's methods
All the methods follows the node culture.
Change the natural behaviour of fs.exists to the node culture, it will return an error in the first callback parameter. As exists is deprecated if it cease to exist then exists will use (#existStat) instead
Sync:
enfs.exists("/etc/passwd", function(err, itemExists){
console.log(itemExists ? 'it\'s there' : 'no passwd!');
});
check: fs.exists
Will use fs.access to check if the item exists in the file system and if the process as access to the item.
Sync:
enfs.existAccess("/etc/passwd", function(err,itemExists){
console.log(itemExists ? "it\'s there and have access" : "don\'t exist or don\'t have access");
});
check: fs.access
Will use fs.stat to check if the item exists in the file system.
Sync:
enfs.existStat("/etc/passwd", function(err,itemExists){
console.log(itemExists ? "it\'s there" : "don\'t exist");
});
check: fs.stat
enfs.existLStat("/etc/passwd", function(err,itemExists){
console.log(itemExists ? "it\'s there" : "don\'t exist");
});
check: fs.lstat
Will use fs.fstat to check if the item exists in the file system.
Sync:
enfs.existFStat(enfs.openSync("/etc/passwd","r"), function(err,itemExists){
console.log(itemExists ? "it\'s there" : "don\'t exist");
});
check: fs.fstat
Will use fs.stat or fs.lstat or fs.fstat to check if the item exists in the file system, and if it's a directory. This method is just a shortcut to check if an item exists in the file system and it's type
Sync:
enfs.existStatIsDirectory("/etc", function(err,isDirectory,stat){
console.log(isDirectory ? "it's a directory" : "don\'t exist or it's not a directory.");
});
check: fs.stat fs.lstat fs.fstat
Will use fs.stat or fs.lstat or fs.fstat to check if the item exists in the file system, and if it's a file. This method is just a shortcut to check if an item exists in the file system and it's type
Sync:
enfs.existStatIsFile("/etc/passwd", function(err,isFile,stat){
console.log(isFile ? "it's a file" : "don\'t exist or it's not a file.");
});
check: fs.stat fs.lstat fs.fstat
Will use fs.lstat to check if the item exists in the file system, and if it's a symbolic link. This method is just a shortcut to check if an item exists in the file system and it's type
Sync:
enfs.existIsSymlink("/etc/symlink", function(err,isSymlink,stat){
console.log(isSymlink ? "it's a symlink" : "don\'t exist or it's not a symlink.");
});
check: fs.lstat
Creative Commons Attribution 4.0 International License
Copyright (c) 2016 Joao Parreira joaofrparreira@gmail.com GitHub
This work is licensed under the Creative Commons Attribution 4.0 International License. To view a copy of this license, visit CCA4.
FAQs
Additional methods for node fs module
The npm package enfsaddins receives a total of 8 weekly downloads. As such, enfsaddins popularity was classified as not popular.
We found that enfsaddins demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.